<?php

//用户管理
Route::group([
    'namespace' => 'App\Http\Controllers\UserCenter',
    'prefix' => 'userCenter/user',
    'middleware' => ['response'],
//    'middleware' => ['response', 'auth'],
], function () {
    Route::get('/info', "UserController@getUserInfo");//用户详情
    Route::get('/list', "UserController@getUserList");
    Route::post('/add', "UserController@addUser");//添加用户
    Route::post('/login', "UserController@loginMember");//用户登录
    Route::post('/loginOut', "UserController@loginOut");//用户登出
    Route::put('/edit', "UserController@editUser");//用户编辑
    Route::delete('/del', "UserController@delUser");
});

//部门管理
Route::group([
    'namespace' => 'App\Http\Controllers\UserCenter',
    'prefix' => 'userCenter/department',
    'middleware' => ['response'],
//    'middleware' => ['response', 'auth'],
], function () {
    Route::get('/info', "DepartmentController@getDepartmentInfo");
    Route::get('/list', "DepartmentController@getDepartmentList");
    Route::post('/add', "DepartmentController@addDepartment");
    Route::put('/edit', "DepartmentController@editDepartment");
    Route::delete('/del', "DepartmentController@delDepartment");
});

//角色管理
Route::group([
    'namespace' => 'App\Http\Controllers\UserCenter',
    'prefix' => 'userCenter/role',
    'middleware' => ['response'],
], function () {
    Route::get('/list', "RolesController@getRolesList");
    Route::get('/info', "RolesController@getRolesInfo");
    Route::get('/tree_str', "RolesController@getRolesTreeList");
    Route::post('/add', "RolesController@addRoles");
    Route::put('/edit', "RolesController@editRoles");
    Route::delete('/del', "RolesController@delRoles");
});

//权限管理
Route::group([
    'namespace' => 'App\Http\Controllers\UserCenter',
    'prefix' => 'userCenter/rules',
    'middleware' => ['response'],
], function () {
    Route::get('/tree_list', "RulesController@getRulesTreeList");
    Route::get('/list', "RulesController@getRulesList");
    Route::get('/info', "RulesController@getRulesInfo");
    Route::post('/add', "RulesController@addRules");
    Route::put('/edit', "RulesController@editRules");
    Route::delete('/del', "RulesController@delRules");
});
